with open("demo1.txt", "r") as f:
    line = f.readline()
    i = 1
    while (line != ""):
        print("第%d次读出%s" % (i, line))
        i += 1
        line = f.readline()

with open("demo1.txt", "r") as f:
    lines = f.readlines()
    for l in lines:
        print(l, end="")
